CREATE TABLE jms_dm.dm_sqs_abnormal_network_cnt_dt (
                                                       agent_code varchar(100) NULL COMMENT "代理区或者虚拟大区编码",
                                                       agent_name varchar(100) NULL COMMENT "代理区或者虚拟大区名称",
                                                       network_cnt int(11) NULL COMMENT "网点数",
                                                       before_networ_cnt int(11) NULL COMMENT "上一天网点数",
                                                       incr_networ_cnt int(11) NULL COMMENT "新增网点数",
                                                       network_cnt_rt decimal64(16, 2) NULL COMMENT "环比 *100后的",
                                                       low_networ_cnt int(11) NULL COMMENT "减少网点数",
                                                       target_value int(11) NULL COMMENT "目标值",
                                                       over_value int(11) NULL COMMENT "超出目标值",
                                                       data_type varchar(100) NULL COMMENT "统计类型 筛单 、爆仓",
                                                       date_time date NULL COMMENT "统计时间",
                                                       agent_type varchar(100) NULL COMMENT "类型：虚拟区、代理区"
) ENGINE=OLAP
DUPLICATE KEY(agent_code)
COMMENT "网点滞留预警汇总"
PARTITION BY RANGE (date_time) (
    START ("2023-02-28") END ("2023-03-05") EVERY (INTERVAL 1 day)
)
DISTRIBUTED BY HASH(agent_code) BUCKETS 1
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-2",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "1",
"in_memory" = "false",
"storage_format" = "V2"
);


ALTER TABLE jms_dm.dm_sqs_abnormal_network_cnt_dt SET ("dynamic_partition.start" = "-186");
ALTER TABLE jms_dm.dm_sqs_abnormal_network_interceptor_detail_dt SET ("dynamic_partition.start" = "-186");
